package com.foreknow.demo10;

/**
 * 字符串String以及常用的方法
 * String concat(String str) 将指定字符串
 */
public class StringDemo {
    public static void main(String[] args) {
        String s = "tom";
        String s_new = "hello "+s;
        String snew = s.concat("hello ");

        System.out.println(s);
        System.out.println(s_new);
        System.out.println(snew);
        System.out.println("hamburger".substring(4,8));
        System.out.println("smiles".substring(1,5));

        String reg = "aa,bb,cc,dd";
        String[] result = reg.split(",");
        for (int i = 0;i<result.length;i++){
            System.out.print(result[i]);
        }
    }
}
